import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HrMonthlyAssessmentResultVO, HrMonthlyAssessmentResultForm, HrMonthlyAssessmentResultQuery } from '@/api/general/humanresources/performance/result/types';

/**
 * 查询员工月度考核结果审批列表
 * @param query
 * @returns {*}
 */

export const listHrMonthlyAssessmentResult = (query?: HrMonthlyAssessmentResultQuery): AxiosPromise<HrMonthlyAssessmentResultVO[]> => {
  return request({
    url: '/humanresource/hrMonthlyAssessmentResult/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询员工月度考核结果审批详细
 * @param id
 */
export const getHrMonthlyAssessmentResult = (id: string | number): AxiosPromise<HrMonthlyAssessmentResultVO> => {
  return request({
    url: '/humanresource/hrMonthlyAssessmentResult/' + id,
    method: 'get'
  });
};

/**
 * 新增员工月度考核结果审批
 * @param data
 */
export const addHrMonthlyAssessmentResult = (data: HrMonthlyAssessmentResultForm) => {
  return request({
    url: '/humanresource/hrMonthlyAssessmentResult',
    method: 'post',
    data: data
  });
};

/**
 * 修改员工月度考核结果审批
 * @param data
 */
export const updateHrMonthlyAssessmentResult = (data: HrMonthlyAssessmentResultForm) => {
  return request({
    url: '/humanresource/hrMonthlyAssessmentResult',
    method: 'put',
    data: data
  });
};

/**
 * 删除员工月度考核结果审批
 * @param id
 */
export const delHrMonthlyAssessmentResult = (id: string | number | Array<string | number>) => {
  return request({
    url: '/humanresource/hrMonthlyAssessmentResult/' + id,
    method: 'delete'
  });
};
